/**
 * 
 */
package cn.miao.learn.ssh.services.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.defaults.DefaultSqlSessionFactory;
import org.springframework.stereotype.Service;

import cn.miao.learn.ssh.beans.TUser;
import cn.miao.learn.ssh.sqlmapper.TUserMapper;

/**
 * @author nealmiao
 *
 */
@Service(value="TestMyBatis")
public class TestMyBatisServiceImpl implements TUserMapper {

	@Resource(name="sqlSessionFactory")
	DefaultSqlSessionFactory sessionFactory;
	@Override
	public List<TUser> selectTUserByExample(TUser user) {
		SqlSession seession = sessionFactory.openSession();
		List<TUser> list = seession.selectList(
				"cn.miao.learn.ssh.sqlmapper.TUserMapper.selectTUserByExample");
		for (TUser use3r : list) {
			System.out.println(use3r.toString());
		}
		seession.close();
		return list;
	}

}
